
Copy My Stance V 4.0

(ACTION MENU OPERATION)

WARNING: Armoury mode will not function correctly with this version.

12/9/2010

By Caxton Gibbet

Description.
************

This addon will make a players AI team copy the players stance.
It can be switched on and off via the action menu.

It would seem that the "Keep Low" command is not entirely a "copy my stance" order as 
indicated by the vocal command sometimes associated with a "Keep Low" order in game.
In fact when a 'keep low' order is issued to a unit parseing the 'Unitpos unit' command on that
unit returns the value "AUTO".
AI units will copy a prone or standing stance.I wanted them to also copy a crouch stance. 

This addon may be rendered obsolete by future game patches.

The scripts Detect Changes in the player's stance and issue updated stance rules to the 
players group.Any unit in the players group that is under stance rule "AUTO", 
'Keep Low' in menu 7,will act on these rule changes.Any unit that has been given any
other stance rule via menu 7 will retain those rules over those issued by the scripts.

To have A unit with,for example,a 'stay crouched' order begin to copy the player's stance
simply give it a 'Keep Low' order and ensure 'copy my stance' is switched on in the action
menu,the system switched ON is indicated by the 'Copy stance off' option appearing in the 
action menu.The system OFF is indicated by the 'Copy My Stance' option appearing in the Action
menu.If either of those options are not available its because you're not the group leader.

ANYTIME the system is deactivated the rule "AUTO" is given to the team as it is the default order of 
all units that haven't recived other rules via menu 7 or as a 'SetUnitPos' command by the mission maker.

ANYTIME the system is deactivated automaticaly,for example,if you change from being team leader to not.
When it is re-activated by,for example,you becoming team leader again it will always be in the mode it
was deactivated in.ie On or Off.

If you enter a vehicle the system is shut down and the stance rule "AUTO" is parsed to your team.
This is because the action menu options to control the system are not available whilst you are in
a vehicle.Once you exit the vehicle the system will re-start in the last mode it was in.ie if switched
off when you mount a vehicle it will be switched off when you dismount.Once you dismount the vehicle
the action menu options will be available again,Provided of course that you are still team leader.

*NOTE Any rules applied in the editor via 'setunitpos' on the Players team will be over ridden by 

the Addon at startup as the default setting for the addon is Switched on IF YOU BEGIN AS TEAM LEADER.

REQUIREMENTS.
*************
You will need the latest version of CBA ('extended_init_eventhandlers')

find it here: [url]http://dev-heaven.net/projects/list_files/cca[/url]
or here:  [url]http://www.armaholic.com/page.php?id=6231[/url]

LIMITATIONS\ISSUES
*******************
When Units are added to the players team,(Recruit\spawn),Simply change stance or switch system off then on to
have the new units copy your stance.

When the player equips a rocket launcher the ai team will sometimes adopt a crouch or prone stance.This is a game function.

While testing with different troop addons I found that it would only initiate on SOME units from
bb_mercs by SchnapsdroSel-(V.4.0).Also it will not initiate on Binkowski's genreic US special forces-(V.1.0).

I came up with a workaround for this,At the moment as long as there is another unit in the mission on which 
the addon does initiate,(eg. ANY vanilla units, including mounted Crew and pilots),then the addon will initiate on 
the players Unit.Beaware that if the only working units are to be spawned by,for example,the civillian module then
the addon will not initiate until the first civillian\unit is spawned.

If the above fix is not of use then simply parse:

nul = [player] execVM "GIB_Copy_Stance\GIB_Copy_Stance_FORCE.sqf";

somwhere in your mission.

I would suspect that this is not MP compatible,but I haven't tested it.
There is no Bisign file simply because I haven't a clue how to create one and this is unlikely to 
work in multiplayer anyway.

HISTORY
********
V.4.0

Fixed: Minor script error.

V.3.01

Fixed: Removed Debug text "RUN" which was left in by mistake.

V.3.0

Added: Support for Prone with launcher animation from SLX and ACE2.(Mods NOT Required).
Fixed: Player static crouch not being seen on mod start up.

V.2.03

Created a Work around for the addons faliure to initiate on some addon units.

-As long as ANY unit type on which the addon initiates is present 
 in the mission,(eg. ANY vanila units including mounted crew and pilots),then
 the addon will initiate on the player.

V.2.02

binarized addon.

V.2.01

Added: checks for player using binoculars and laser designator.

Added: checks for unarmed player.

V.2.00

refined the system and then Re-wrote all scripts in .sqf format.

Fixed: Issues around teamswitch and joining or leaving Groups.

V.1.00

Initial release